<template>
  <div class="list">
    <div class="section">
      <el-table
        :data="tableData"
        style="width: 100%">
        <el-table-column
          align="center"
          prop="title"
          label="企业名称">
        </el-table-column>
        <el-table-column
          align="center"
          prop="recharge"
          :formatter="formatAmount"
          label="充值金额">
        </el-table-column>
        <el-table-column
          align="center"
          prop="refund"
          :formatter="formatAmount"
          label="退款金额">
        </el-table-column>
        <el-table-column
          align="center"
          prop="balance"
          :formatter="formatAmount"
          label="余额">
        </el-table-column>
        <el-table-column
          align="center"
          :formatter="formatAmount"
          prop="expend"
          label="总消费">
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>
<script>
export default {
  name: 'list',
  data() {
    return {
      tableData: []
    }
  },
  methods: {
    formatAmount(row, column, cellValue, index) {
      return cellValue || 0
    }
  },
  created() {
    this.$http.get('/company/company/inex').then(res => {
      if (res.status === 1) {
        this.tableData = [res.data.info]
      }
    })
  }
}
</script>